import React from 'react';
import ReactDOM from 'react-dom';
import { Router, Route, IndexRoute, Redirect, browserHistory,hashHistory} from 'react-router';

// 引入单个页面（包括嵌套的子页面）
import Init from './main';
import Home from './pages/home';
import City from './pages/city';
import Table from './pages/table';


// 配置路由，并将路由注入到id为init的DOM元素中
ReactDOM.render(
    <Router history={hashHistory}>
        <Route path="/" component={Init} >
            <IndexRoute component={Home}/>
            <Route path="city" component={City}/>
            <Route path="table" component={Table}/>
        </Route>
    </Router>
    , document.querySelector('#init')
);